#include "camera/Camera.h"
#include "math/Matrix4.h"

Camera::Camera(float left, float right, float bottom, float top, float znear, float zfar)
{
	m_CameraPos = Vector3(0.0f, 0.0f, 0.0f);
	m_CameraFront = Vector3(0.0f, 0.0f, -1.0f);
	m_CameraRight = Vector3::Normalize(Vector3::Cross(m_CameraFront, Vector3(0.0f, 1.0f, 0.0f)));
	m_CameraUp =Vector3::Normalize(Vector3::Cross(m_CameraRight, m_CameraFront));

	m_ViewMatrix = LookAt(m_CameraPos, m_CameraPos + m_CameraFront, m_CameraUp);
	m_ProjectionMatrix = Orthographic(left, right, bottom, top,znear,zfar);
}

Camera::Camera(float fov, float aspect, float nearPlane, float farPlane)
{
	m_CameraPos = Vector3(0.0f, 0.0f, 0.0f);
	m_CameraFront = Vector3(0.0f, 0.0f, -1.0f);
	m_CameraRight =Vector3::Normalize(Vector3::Cross(m_CameraFront, Vector3(0.0f, 1.0f, 0.0f)));
	m_CameraUp = Vector3::Normalize(Vector3::Cross(m_CameraRight, m_CameraFront));

	m_ViewMatrix = LookAt(m_CameraPos, m_CameraPos + m_CameraFront, m_CameraUp);
	m_ProjectionMatrix = Perspective(fov, aspect, nearPlane, farPlane);
}

Camera::~Camera()
{
}
